﻿using Transformable_Engine_v2.Engine.Animation.FrameAnimation;

namespace Platformer_Example.Content.Images.Player
{
    public class PlayerAnimations
    {
         public class Normal
         {
             public class Walk : FrameAnimationDescription
             {
                 public Walk()
                 {
                     IsLooping = true;

                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Walk0), 0, 1));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Walk1), 1, 2));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Walk2), 2, 3));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Walk3), 3, 4));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Walk4), 4, 5));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Walk5), 5, 0));

                     FrameRate = 10;
                 }
             }
             public class WalkCarry : FrameAnimationDescription
             {
                 public WalkCarry()
                 {
                     IsLooping = true;

                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Carry0), 0, 1));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Carry1), 1, 2));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Carry2), 2, 3));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Carry3), 3, 4));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Carry4), 4, 5));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.WalkState.Carry5), 5, 0));

                     FrameRate = 10;
                 }
             }

             public class Pickup : FrameAnimationDescription
             {
                 public Pickup()
                 {
                     IsLooping = false;
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.PickupState.Pickup0), 0, 1));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.PickupState.Pickup1), 1, 2));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.PickupState.Pickup2), 2, 3));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.PickupState.Pickup3), 3, -1) { IsLastFrame = true });

                     FrameRate = 10;
                 }
             }

             public class Attack : FrameAnimationDescription
             {
                 public Attack(float speed)
                 {
                     IsLooping = false;

                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.AttackState.Attack0), 0, 1));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.AttackState.Attack1), 1, 2));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.AttackState.Attack2), 2, 3));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.AttackState.Attack3), 3, 4));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.AttackState.Attack4), 4, 5));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.AttackState.Attack5), 5, 6) { IsLastFrame = true });

                     FrameRate = 30 * speed;
                     Frames[5].Duration = (int) (500 / speed);
                 }
             }

             public class LadderClimb : FrameAnimationDescription
             {
                 public LadderClimb()
                 {
                     IsLooping = true;

                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.LadderState.Climb1), 0, 1));
                     AddFrame(new FrameDescription(SpritesheetPlayer.GetSprite(SpritesheetPlayer.LadderState.Climb0), 1, 0));

                     FrameRate = 8;
                 }
             }
         }
    }
}